<?php
include 'db.inc.php';
$mysqli=mysqli_connect($hostname, $username, $password, $db);


$query = "SELECT * FROM Rooms rm JOIN RoomTypes rtype ON rm.roomTypeCode = rtype.roomTypeCode ";

$result = mysqli_query($mysqli,$query)or die(mysqli_error());

$rows = array();
while($r = mysqli_fetch_assoc($result)) {
    $rows[] = $r;
}
print json_encode($rows);


?>